Skip to content

feat(argocd): register actions for application management#8539

Merged
CryptoRodeo merged 1 commit intobackstage:mainfrom
drodil:argocd_actions
Apr 21, 2026
Merged

feat(argocd): register actions for application management#8539
CryptoRodeo merged 1 commit intobackstage:mainfrom
drodil:argocd_actions

Conversation

@drodil
Copy link
Copy Markdown
Contributor

@drodil drodil commented Apr 13, 2026

Hey, I just made a Pull Request!

4 new actions for argocd backend

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

@backstage-goalie
Copy link
Copy Markdown
Contributor

backstage-goalie Bot commented Apr 13, 2026

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-argocd-backend workspaces/argocd/plugins/argocd-backend patch v1.4.0

@CryptoRodeo
Copy link
Copy Markdown
Contributor

@drodil please resolve the conficts

Copilot AI review requested due to automatic review settings April 17, 2026 07:47
@drodil drodil requested a review from dzemanov as a code owner April 17, 2026 07:47
@drodil
Copy link
Copy Markdown
Contributor Author

drodil commented Apr 17, 2026

@CryptoRodeo done

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Actions API registrations to the ArgoCD backend plugin to support application-management workflows via Backstage actions.

Changes:

  • Registers four new ArgoCD Actions API actions (argocd:find-applications, argocd:get-application, argocd:list-applications, argocd:get-revision-details).
  • Wires ArgoCDService into action registration and adds unit tests for each new action.
  • Cleans up argocd-backend dependencies (removes undici) and updates lockfile/knip report.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
workspaces/argocd/yarn.lock Removes undici from argocd-backend dependency graph.
workspaces/argocd/plugins/argocd-backend/src/plugin.ts Instantiates ArgoCDService and registers all ArgoCD actions at plugin init.
workspaces/argocd/plugins/argocd-backend/src/index.ts Changes public exports (removes createArgoCDResourceAction from entrypoint).
workspaces/argocd/plugins/argocd-backend/src/actions/index.ts Expands action registrations and changes createArgoCDActions signature.
workspaces/argocd/plugins/argocd-backend/src/actions/createListApplicationsAction.ts New argocd:list-applications action.
workspaces/argocd/plugins/argocd-backend/src/actions/createListApplicationsAction.test.ts Unit tests for list-applications action.
workspaces/argocd/plugins/argocd-backend/src/actions/createGetRevisionDetailsAction.ts New argocd:get-revision-details action.
workspaces/argocd/plugins/argocd-backend/src/actions/createGetRevisionDetailsAction.test.ts Unit tests for get-revision-details action.
workspaces/argocd/plugins/argocd-backend/src/actions/createGetApplicationAction.ts New argocd:get-application action.
workspaces/argocd/plugins/argocd-backend/src/actions/createGetApplicationAction.test.ts Unit tests for get-application action.
workspaces/argocd/plugins/argocd-backend/src/actions/createFindApplicationsAction.ts New argocd:find-applications action.
workspaces/argocd/plugins/argocd-backend/src/actions/createFindApplicationsAction.test.ts Unit tests for find-applications action.
workspaces/argocd/plugins/argocd-backend/package.json Removes undici dependency from argocd-backend package.
workspaces/argocd/plugins/argocd-backend/knip-report.md Updates knip output (now empty report).
workspaces/argocd/.changeset/sweet-moles-remain.md Adds changeset describing newly registered actions (currently marked as patch).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread workspaces/argocd/.changeset/sweet-moles-remain.md
Comment thread workspaces/argocd/plugins/argocd-backend/src/index.ts Outdated
Comment thread workspaces/argocd/plugins/argocd-backend/src/actions/index.ts
Comment thread workspaces/argocd/plugins/argocd-backend/src/plugin.ts
@CryptoRodeo
Copy link
Copy Markdown
Contributor

CryptoRodeo commented Apr 17, 2026

Testing new actions with scaffolder templates

change in app-config.yaml:

    - type: file
      target: ../../examples/templates/argocd-find-applications.yaml
      rules:
        - allow: [Template]

    - type: file
      target: ../../examples/templates/argocd-get-application.yaml
      rules:
        - allow: [Template]

    - type: file
      target: ../../examples/templates/argocd-get-revision-details.yaml
      rules:
        - allow: [Template]

    - type: file
      target: ../../examples/templates/argocd-list-applications.yaml
      rules:
        - allow: [Template]

Get ArgoCD Application

Template: (argocd-get-application.yaml)

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: argocd-get-application
  title: Get ArgoCD Application
  description: Get full details of a specific ArgoCD application from a named instance
  tags:
    - argocd
    - deployment
    - kubernetes
spec:
  owner: group:default/infrastructure
  type: deployment
  parameters:
    - title: ArgoCD Application Details
      required:
        - instanceName
        - appName
      properties:
        instanceName:
          title: ArgoCD Instance
          type: string
          description: Name of the ArgoCD instance as configured in argocd.appLocatorMethods[].instances
        appName:
          title: Application Name
          type: string
          description: The ArgoCD application name
        appNamespace:
          title: Application Namespace
          type: string
          description: Namespace of the application
        project:
          title: Project Name
          type: string
          description: ArgoCD project name
  steps:
    - id: get-application
      name: Get ArgoCD Application
      action: backstage-community-argocd:argocd:get-application
      input:
        instanceName: ${{ parameters.instanceName }}
        appName: ${{ parameters.appName }}
        appNamespace: ${{ parameters.appNamespace }}
        project: ${{ parameters.project }}
  output:
    text:
      - title: Application Status
        content: |
          **Name:** ${{ steps['get-application'].output.name }}
          **Sync:** ${{ steps['get-application'].output.syncStatus }}
          **Health:** ${{ steps['get-application'].output.healthStatus }}
          **Resources:** ${{ steps['get-application'].output.resourcesCount }}

Demo:

get-argocd-application-demo.mp4

Get ArgoCD Revision Details

Template: (argocd-get-revision-details.yaml)

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: argocd-get-revision-details
  title: Get ArgoCD Revision Details
  description: Fetch the Git commit metadata for a specific revision of an ArgoCD application deployment
  tags:
    - argocd
    - deployment
    - kubernetes
spec:
  owner: group:default/infrastructure
  type: deployment
  parameters:
    - title: Revision Details
      required:
        - instanceName
        - appName
        - revisionID
      properties:
        instanceName:
          title: ArgoCD Instance
          type: string
          description: Name of the ArgoCD instance
        appName:
          title: Application Name
          type: string
          description: The ArgoCD application name
        revisionID:
          title: Revision ID
          type: string
          description: Git commit SHA or tag to get details for
        appNamespace:
          title: Application Namespace
          type: string
          description: Namespace of the application
  steps:
    - id: get-revision-details
      name: Get Revision Details
      action: backstage-community-argocd:argocd:get-revision-details
      input:
        instanceName: ${{ parameters.instanceName }}
        appName: ${{ parameters.appName }}
        revisionID: ${{ parameters.revisionID }}
        appNamespace: ${{ parameters.appNamespace }}
  output:
    text:
      - title: Revision Info
        content: |
          **Author:** ${{ steps['get-revision-details'].output.author }}
          **Date:** ${{ steps['get-revision-details'].output.date }}
          **Message:** ${{ steps['get-revision-details'].output.message }}
get-argocd-revision-details.mp4

List ArgoCD Applications

Template: (argocd-list-applications.yaml)

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: argocd-list-applications
  title: List ArgoCD Applications
  description: List ArgoCD applications on a specific instance with optional filtering
  tags:
    - argocd
    - deployment
    - kubernetes
spec:
  owner: group:default/infrastructure
  type: deployment
  parameters:
    - title: List ArgoCD Applications
      required:
        - instanceName
      properties:
        instanceName:
          title: ArgoCD Instance
          type: string
          description: Name of the ArgoCD instance as configured in argocd.appLocatorMethods[].instances
        selector:
          title: Label Selector
          type: string
          description: "Label selector to filter applications, e.g. app.kubernetes.io/part-of=my-app"
        project:
          title: Project Name
          type: string
          description: Filter by ArgoCD project name
        appNamespace:
          title: Application Namespace
          type: string
          description: Filter by application namespace
  steps:
    - id: list-applications
      name: List ArgoCD Applications
      action: backstage-community-argocd:argocd:list-applications
      input:
        instanceName: ${{ parameters.instanceName }}
        selector: ${{ parameters.selector }}
        project: ${{ parameters.project }}
        appNamespace: ${{ parameters.appNamespace }}
  output:
    text:
      - title: Applications Found
        content: |
          Total: ${{ steps['list-applications'].output.totalCount }}

          ```json
          ${{ steps['list-applications'].output.applications | dump }}
          ```

Demo:

list-argocd-apps-demo.mp4

Find ArgoCD Applications

I was unable to get apps with this one...

Template: (argocd-find-applications.yaml)

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: argocd-find-applications
  title: Find ArgoCD Applications
  description: Find all ArgoCD applications across all configured instances by application name
  tags:
    - argocd
    - deployment
    - kubernetes
spec:
  owner: group:default/infrastructure
  type: deployment
  parameters:
    - title: Find ArgoCD Applications
      required:
        - appName
      properties:
        appName:
          title: Application Name
          type: string
          description: The ArgoCD application name to search for
        project:
          title: Project Name
          type: string
          description: Filter by ArgoCD project name
        appNamespace:
          title: Application Namespace
          type: string
          description: Filter by application namespace
  steps:
    - id: find-applications
      name: Find ArgoCD Applications
      action: backstage-community-argocd:argocd:find-applications
      input:
        appName: ${{ parameters.appName }}
        project: ${{ parameters.project }}
        appNamespace: ${{ parameters.appNamespace }}
  output:
    text:
      - title: Found Instances
        content: |
          ```json
          ${{ steps['find-applications'].output.instances | dump }}
          ```

Demo:

find-argocd-applications-demo.mp4

I think this is a bug. After adding expand: 'applications' to createFindApplicationsAction.ts I was able to get back results:

      const results = await argoCDService.findApplications({
        appName: input.appName,
        project: input.project,
        appNamespace: input.appNamespace,
        expand: 'applications', // <- HERE
      });

Demo with Fix:

Screencast.From.2026-04-17.16-26-16.mp4

Besides the bug, maybe adding some scaffolder and action templates would make local testing easier for other devs? I can add the example templates in another PR if you prefer to not add them in this one 🙂

… management

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
Copilot AI review requested due to automatic review settings April 20, 2026 05:47
@drodil
Copy link
Copy Markdown
Contributor Author

drodil commented Apr 20, 2026

I added the expand parameter, good catch! I think you can add the templates as you already have them in place in another PR, if that's ok?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@CryptoRodeo CryptoRodeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drodil Yeah that's fine, I can tackle that in another PR, thanks!

@CryptoRodeo CryptoRodeo merged commit 53f7107 into backstage:main Apr 21, 2026
16 of 17 checks passed
evanlankveld pushed a commit to evanlankveld/community-plugins that referenced this pull request Apr 28, 2026
… management (backstage#8539)

Signed-off-by: Hellgren Heikki <heikki.hellgren@op.fi>
Signed-off-by: Emiel van Lankveld <evanlankveld@bol.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants